package cn.smbms.dao.role;

import cn.smbms.dao.provider.ProviderMapper;
import cn.smbms.pojo.Provide;
import cn.smbms.pojo.Role;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class RoleMapperImpl implements RoleMapper {

    private SqlSessionTemplate sqlSession;

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

    @Override
    public int add(Role role) {
        return sqlSession.getMapper(RoleMapper.class).add(role);
    }

    @Override
    public List<Role> getroleName(Role role) {
        return sqlSession.selectList("cn.smbms.dao.role.RoleMapper.getroleName",role);
    }

    @Override
    public int up(Role role) {
        return sqlSession.getMapper(RoleMapper.class).up(role);
    }

    @Override
    public int del(Role role) {
        return sqlSession.getMapper(RoleMapper.class).del(role);
    }
}
